<?php
session_start();
include_once '../model/SalesItem.php';
include_once '../model/Product.php';
include_once '../util/database_conn.php';



$items = array();

if($_SESSION['items']!=null){
    $items = $_SESSION['items'];
}

$item = new SalesItem();
$item->setProduct(Product::load($_POST['id']));
$item->setPrice(Product::load($_POST['id'])->getPrice());
$item->setQty($_POST['qty']);

array_push($items, $item);


$_SESSION['items'] = $items;

mysql_close($conn)
?>
